package com.basic.service.vo;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.List;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class DataBasesParam implements Serializable {

    private Integer port;

    @NotBlank(message = "驱动类路径不能为空")
    private String driverClass;

    @NotBlank(message = "连接不能为空")
    private String url;

    @NotBlank(message = "用户名不能为空")
    private String username;

    @NotBlank(message = "用户密码不能为空")
    private String passwd;

    private List<String> tableNames;

    @NotBlank(message = "作者名不能为空")
    private String author;

    @NotBlank(message = "模块名不能为空")
    private String module;

    @NotBlank(message = "包路径不能为空")
    private String packagePath;

    @NotBlank(message = "zip路径不能为空")
    private String zipPath;

    public String getZipPathFormat() {
        return zipPath + module + ".zip";
    }
}
